<template>
    <ul class="list-group">
      <li class="list-group-item"  style="background-image: linear-gradient(to top, #6a85b6 0%, #bac8e0 100%);color: #fff;display: flex;font-size: 16px;"><strong>{{datalist.title}}</strong></li>
        <li class="list-group-item">
            <div>
              
                <textarea
                rows="5"
                class="content"
                placeholder="请输入内容"
                v-model="aa"
              />

            </div>
        </li>
</ul>
</template>
<script>
	export default {
          name: 'Shortanswer',
          props:{
            datalist:Object,
            questionnaireId:0
          },
	data() {
		return {
		aa:[],
		};
	},
    watch:{
        aa(newValue, oldValue){
            console.log('被选中的值为:'+newValue)
     
            let _a={'questionnaireId':this.questionnaireId,'questionId':this.datalist.questionId,'answerId':newValue}
                this.$emit('ontest', _a)

        }
    
    },
  methods:{
    test(e){
    //  console.log('被选中的值为:'+e)
    let _a={'id':this.datalist.id,'q':e}

 
    this.$emit('ontest', _a)
    }
  },
     
}                           
  </script>
<style>
.content{
    width: 100%;
    border: 0;
}
</style>